package com.example.springboot.web;

import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.HashMap;
import java.util.Map;

@RestController
public class RESTfulController {


    /**
     * http://localhost:9090/014-springboot-restful/springBoot/student/wangpeng/23
     * @param name
     * @param age
     * @return
     */
    @PostMapping(value = "/add/{name}/{age}")
    public Object addStudent(@PathVariable("name") String name,
                             @PathVariable("age") Integer age) {


        Map<String, Object> retMap = new HashMap<>();
        retMap.put("name",name);
        retMap.put("age",age);


        return retMap;
    }
}
